<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>

<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<title>后台管理</title>
</head>
<body class="body_ifm">
	<div id="preview" style="display:none;width:450px ">
   		<div style="height:380px; overflow:auto;width:450px;">
       		<form class="layui-form" action="index.php?m=trainnews&c=newstatus" target="supportiframe" method="post" onSubmit="return tcdiv();">
         		
         		<input type="hidden" name="pytoken" id='pytoken' value="{yun:}$pytoken{/yun}">
            	
            	<table cellspacing='1' cellpadding='1' class="admin_examine_table">
	                <tr>
	             		<th>机构名称：</th>
	                    <td align="left"><span id="newsname"></span></td>
	                </tr>
            		<tr>
                        <th width="85">新闻审核：</th>
                        <td align="left">
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <input name="r_status" id="nlstatus1"  value="1" title="正常" type="radio" lay-filter="nlstatus" />
                                    <input name="r_status" id="nlstatus3"  value="3" title="未通过" type="radio" lay-filter="nlstatus" />
                                </div>
                            </div>
                        </td>
                    </tr> 
                     
                    <tr class="tbcss">
                        <th >机构审核：</th>
                        <td align="left">
                            <div class="layui-form-item">
                                <div class="layui-input-inline">
                                    <input name="istb" id="istb" value="1" title="同步" type="checkbox"  lay-skin="primary" checked="checked"  disabled="disabled"/>
                             	</div>
                            </div>
                        </td>
                    </tr>
                    <tr class="tbcss"> <th>同步说明：</th>  <td align="left"><div class="sh_sm">培训机构身份状态根据课程状态同步审核</div>	  </td></tr>
                    <tr>
                        <th>审核说明：</th>
                        <td align="left"> <textarea id="statusbody" name="statusbody" class="shsm_textarea"></textarea></td>
                    </tr>
                    <tr>
                        <td colspan='2' align="center">
                            <div class="admin_Operating_sub"> <input type="submit" value='确认' class="admin_examine_bth"> <input type="button" onClick="layer.closeAll();" class="admin_examine_bth_qx" value='取消'></div>
                        </td>
                    </tr>
            	</table>
             	<input name="nid" value="0" type="hidden">
            	<input name="nuid" value="0" type="hidden">
        	</form>
     	</div>
   	</div>
<div id="status_div"  style="display:none; width: 380px; ">   
      <form class="layui-form" action="index.php?m=trainnews&c=status" target="supportiframe" method="post" onsubmit="return htStatus()"> 
      <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
        <table cellspacing='1' cellpadding='1' class="admin_examine_table">
     <tr>
    <th width="80">审核操作：</th>
     <td align="left">
    
			<div class="layui-form-item">
                 <div class="layui-input-block">
                    <div class="admin_examine_right"style="width:300px;">
						<input name="status" id="status1" value="1" title="正常" type="radio"/>
						<input name="status" id="status2" value="2" title="未通过" type="radio"/>
                    </div>
                  </div>
             </div>	
		</td>
        </tr>
		<tr>
            <th>审核说明：</th>
          <td>  
          <textarea id="alertcontent" name="statusbody" class="admin_explain_textarea"></textarea></div>
	</tr>
         <tr>
              <td colspan='2' align="center"> 
               <input type="submit" value='确认' class="admin_examine_bth">
			   <input type="button" onClick="layer.closeAll();" class="admin_examine_bth_qx" value='取消'>
		</td>
         </tr>
        <input name="pid" value="0" type="hidden"> 
         </table>
      </form> 
</div> 
 <div class="infoboxp">
 <div class="admin_new_tip">
<a href="javascript:;" class="admin_new_tip_close"></a>
<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
<div class="admin_new_tip_list_cont">
<div class="admin_new_tip_list">该页面展示了网站所有的培训新闻管理信息，可对培训新闻进行审核删除操作。</div>
<div class="admin_new_tip_list">可输入名称关键字进行搜索，也可进行详细的高级搜索。</div>
<div class="admin_new_tip_list">当前用户除了已锁定状态，可以正常审核。</div>
<div class="admin_new_tip_list">当前除了已审核状态显示已锁定，显示其他状态（未审核，未通过）。</div>
</div>
</div>

<div class="clear"></div>

<div class="admin_new_search_box"> 
  <form action="index.php" name="myform" method="get">
      <input name="m" value="trainnews" type="hidden"/>
	<div class="admin_new_search_name">搜索类型：</div>
    <div class="admin_Filter_text formselect" did='dtype'>
          <input type="button" value="{yun:}if $smarty.get.type=='1'||$smarty.get.type==''{/yun}机构名称 {yun:}elseif $smarty.get.type=='2'{/yun}新闻标题{yun:}/if{/yun}" class="admin_Filter_but" id="btype">
         <input type="hidden" name="type" id="type" value="{yun:}if $smarty.get.type{/yun}{yun:}$smarty.get.type{/yun}{yun:}else{/yun}1{yun:}/if{/yun}"/>
          <div class="admin_Filter_text_box" style="display:none" id='dtype'>
            <ul> 
              <li><a href="javascript:void(0)" onClick="formselect('1','type','机构名称')">机构名称</a></li>
			  <li><a href="javascript:void(0)" onClick="formselect('2','type','新闻标题')">新闻标题</a></li>
            </ul>
          </div>
        </div>
        <input type="text" placeholder="输入你要搜索的关键字" value="{yun:}$smarty.get.keyword{/yun}" name='keyword' class="admin_Filter_search">
        <input type="submit"  value="搜索" class="admin_Filter_bth">
	<a  href="javascript:void(0)" onclick="$('.admin_screenlist_box').toggle();"   class="admin_new_search_gj">高级搜索</a></form>


  
  {yun:}include file="admin/admin_search.htm"{/yun}
  </div>
<div class="clear"></div> 
  <div class="table-list">
    <div class="admin_table_border">
      <iframe id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
      <form action="index.php" target="supportiframe" name="myform" id='myform' method="get">
      <input type="hidden" name="pytoken"  id='pytoken' value="{yun:}$pytoken{/yun}">
        <input name="m" value="trainnews" type="hidden"/>
        <input name="c" value="del" type="hidden"/>
        <table width="100%">
          <thead>
            <tr class="admin_table_top">
               <th style="width:20px;"><label for="chkall"><input type="checkbox" id='chkAll' onclick='CheckAll(this.form)'/></label></th>
                <th>
				{yun:}if $smarty.get.order=="asc"{/yun}
					<a href="{yun:}searchurl order=desc t=id m=trainnews untype='order,t'{/yun}">编号<img src="images/sanj.jpg"/></a>
                {yun:}else{/yun}
                	<a href="{yun:}searchurl order=asc t=id m=trainnews untype='order,t'{/yun}">编号<img src="images/sanj2.jpg"/></a>
                {yun:}/if{/yun}
				</th>
              <th align="left">机构名称</th>
              <th align="left">新闻标题</th>
              <th>状态</th>
              <th class="admin_table_th_bg">操作</th>
            </tr>
          </thead>
          <tbody>
          {yun:}foreach item=v key=key from=$rows{/yun}
          <tr align="center"  {yun:}if ($key+1)%2=='0'{/yun}class="admin_com_td_bg"{yun:}/if{/yun} id="list{yun:}$v.id{/yun}">
            <td style="width:20px;"><input type="checkbox" value="{yun:}$v.id{/yun}" class="check_all"  name='del[]' onclick='unselectall()' rel="del_chk" /></td>
            <td align="left" class="td1" style="text-align:center;"><span>{yun:}$v.id{/yun}</span></td>
            <td class="ud" align="left">
				<a href="{yun:}url m=train c=agencyshow id=$v.uid{/yun}" target="_blank" class="admin_cz_sc">{yun:}$v.name{/yun}</a>
			</td>
            <td class="ud" align="left"><div style="width:500px;"> <a href="{yun:}url m=train id='`$v.uid`' c=newsshow nid='`$v.id`'{/yun}"  target="_blank" class="admin_cz_yl">{yun:}$v.title{/yun}</a></div></td>
            <td>
               {yun:}if $v.status==1{/yun}
                	<span class="admin_com_Audited">已审核</span>
                {yun:}elseif $v.status==0{/yun}
                	<span class="admin_com_noAudited">未审核</span>
                {yun:}elseif $v.status==2{/yun}
                	<span class="admin_com_tg">未通过</span>
                {yun:}/if{/yun}
         	</td>
            <td><a href="javascript:;"  class="status admin_new_c_bth admin_new_c_bthsh" pid="{yun:}$v.id{/yun}" uid="{yun:}$v.uid{/yun}" newsname="{yun:}$v.name{/yun}"  rstatus="{yun:}$v.r_status{/yun}" status="{yun:}$v.status{/yun}">审核</a> 
             <a href="{yun:}url m=train id=$v.uid c=newsshow nid=$v.id{/yun}"  target="_blank" class="admin_new_c_bth admin_new_c_bth_yl">预览</a> 
             <a href="javascript:void(0)" onClick="layer_del('确定要删除？', 'index.php?m=trainnews&c=del&del={yun:}$v.id{/yun}');"  class="admin_new_c_bth admin_new_c_bth_sc">删除</a></td>
          </tr>
          {yun:}/foreach{/yun}
        <tr>
            <td align="center"><input type="checkbox" id='chkAll2' onclick='CheckAll2(this.form)' /></td>
            <td colspan="5" >
            <label for="chkAll2">全选</label>
            <input class="admin_button" type="button" name="delsub" value="删除所选" onClick="return really('del[]')" />
              &nbsp;&nbsp;
              <input class="admin_button" type="button" name="delsub" value="批量审核" onClick="audall('1');" /></td>
           </tr>
		{yun:}if $total > $config.sy_listnum {/yun}
			<tr>
				{yun:}if $pagenum==1{/yun}
					<td colspan="3"> 从 1 到 {yun:}$config.sy_listnum {/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}else if $pagenum > 1 && $pagenum < $pages{/yun}
					<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$pagenum * $config.sy_listnum{/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}else if $pagenum == $pages{/yun}
					<td colspan="3"> 从 {yun:}($pagenum-1) * $config.sy_listnum + 1{/yun} 到 {yun:}$total{/yun} ，总共 {yun:}$total{/yun} 条</td>
				{yun:}/if{/yun}
				<td colspan="3" class="digg">{yun:}$pagenav{/yun}</td>
			</tr>
		{yun:}/if{/yun}
            </tbody>
          
        </table>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript">
  	layui.use(['layer', 'form'], function(){
   	 	var layer = layui.layer
    		,form = layui.form
    		,$ = layui.$;
   	 	form.on('radio(nlstatus)', function(data){
	       	if(data.value==1){
	       		$("#istb").attr("checked",true);
	       		$("#istb").attr("disabled",true);
	       		$(".tbcss").show();
	       	}else{
	         	$(".tbcss").hide();
	       	}
	       	form.render('checkbox');
 		});
  	});


function audall(status){
		var codewebarr="";
		$(".check_all:checked").each(function(){ //由于复选框一般选中的是多个,所以可以循环输出 
			if(codewebarr==""){codewebarr=$(this).val();}else{codewebarr=codewebarr+","+$(this).val();}
		});
		if(codewebarr==""){
			parent.layer.msg('您还未选择任何信息！', 2, 8);return false; 
		}else{ 
			$("input[name=pid]").val(codewebarr);
			$("#alertcontent").val('');
			$("input[name=status]").attr("checked",false);
			status_div('新闻审核','390','260');
		}
}
$(function(){
	$(".status").click(function(){
  	$("input[name=pid]").val($(this).attr("pid"));
		var id=$(this).attr("pid"); 
		var pytoken=$("#pytoken").val();
		var status=$(this).attr("status");
		$("#status"+status).attr("checked",true);
    	var rstatus=$(this).attr("rstatus");
    	if(rstatus!=1){
       		if(rstatus==2){
          		parent.layer.msg("用户已锁定,无法审核相关信息", 2, 8);
          		return false;
        	}else{
          		var uid=$(this).attr("uid");
		     	$("input[name=nid]").val(id);
		    	$("input[name=nuid]").val(uid);
		      	var newsname = $(this).attr("newsname");
		      	if(rstatus == 0){
            		$("#newsname").html(newsname+'<font color="red">【未审核】</font>');
            	}else if(rstatus == 3){
            		$("#newsname").html(newsname+'<font color="red">【未通过】</font>');
            	}
			    $("#nlstatus1").attr("checked", true);
			    $("#istb").attr("checked",true);
	       		$("#istb").attr("disabled",true);
	       		$(".tbcss").show();
			    $.layer({
			      type: 1,
			      title: '审核操作',
			      closeBtn: [0, true],
			      offset: ['80px', ''],
			      border: [10, 0.3, '#000', true],
			      area: ['450px', '350px'],
			      page: {
			        dom: '#preview'
			      }
			    });
			  }
    }else{
      $("input[name=pid]").val(id);  	
      $.post("index.php?m=trainnews&c=lockinfo",{pytoken:pytoken,id:id},function(msg){
     
        $("#alertcontent").val(msg);
        status_div('新闻审核','390','260');
      });	
    }
		layui.use(['form'],function(){
			var form = layui.form;
			form.render();
		});

	});
}); 
</script>
</body>
</html>